#ifndef _UID_GENERATOR_H_
#define _UID_GENERATOR_H_

namespace toolkit
{
typedef unsigned int uid;

class CUID
{
private:
	uid _bits;
public:
	CUID(): _bits(1){}
	inline uid get()
	{
		__asm
		{
			mov ebx, 1
			bsr	eax, _bits
			shr ebx, eax
			and _bits, ebx
		}
		return _bits;
	}
};
}
#endif //_UID_GENERATOR_H_